package top.xiaoshuaila.moments.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.xiaoshuaila.moments.pojo.RespBean;
import top.xiaoshuaila.moments.service.VisitorService;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("visitor")
@Api(tags = "客态访问接口")
public class VisitorController {
    @Autowired
    private VisitorService visitorService;
    @GetMapping("getInfo")
    @ResponseBody
    @ApiOperation("获取访问用户信息")
    public RespBean visitorInfo(long vid,long id){
        return visitorService.visitorInfo(vid,id);
    }
    @GetMapping("getdynamic")
    @ResponseBody
    @ApiOperation("获取访问用户动态")
    public RespBean visitordynamic(long vid,int page){
        return visitorService.getdynamic(vid,page);
    }
    @GetMapping("gettotal")
    @ResponseBody
    @ApiOperation("获取访问用户动态总数")
    public RespBean gettotal(long vid){
        return visitorService.gettotal(vid);
    }
}
